<style>
.booked_erro
{
	border-color:red !important;
	border-width:2px;
}

.select error
{
	border-color:red !important;
}
</style>
<?php 
## lay bai viet
$args = db_query_all_post_in_post_type(1, 'hotel', 'date', 'DESC', $wpdb->prefix.'display', 'display');
query_posts($args);
if(have_posts())
{
	the_post();
	$postID = get_the_ID();
}
wp_reset_query();
if(wp_verify_nonce($_POST['act_activation_booking_sidebar'],'act_activation_booking_sidebar'))
{
	$_SESSION['my_booking_true_friends'] = $_POST;
}

?>
<div id="sidebar-left">
			<!--booking-->
        	<div class="booking">
            	<span class="iconbooking"></span>
                <h3>BOOKING HOTLES</h3>
                <div class="clear"></div>
                <form action="<?php echo WP_MYSITE_URL;?>/booking.html" method="post">
                	<p><label class="labelfirst">Check - In</label>
                	<input type="text" name="demo1" id="demo1" maxlength="25" size="25" value="<?php if($_SESSION['my_booking_true_friends']['demo1'] != null) echo $_SESSION['my_booking_true_friends']['demo1'];?>"/>
        			<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/date_20.jpg" alt="" onclick="javascript:NewCssCal('demo1')" style="cursor:pointer"/>
						<label class="labelsecond">Adults</label>
                        </p>
                  <div class="parent">
                    <select name="sidebar_adults" id="sidebar_adults">
                       	    	<?php
                       	    	for($i=1;$i<=10;$i++)
                       	    	{
                       	    		if(isset($_SESSION['my_booking_true_friends']) && $_SESSION['my_booking_true_friends']['sidebar_adults']==$i)
                       	    		{
                       	    		?>
                       	    		<option selected="selected" value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php 	
                       	    		}
                       	    		else 
                       	    		{
                       	    		?>
                       	    		<option value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php	
                       	    		}
                       	    	} 
                       	    	?>                       	    		
                       	    	</select>	
                    </div>
					<div class="clear"></div>
					<div class="div10"></div>
					<p><label class="labelfirst">Check - Out</label>
						<input type="text" name="demo2" id="demo2" maxlength="25" size="25" value="<?php if($_SESSION['my_booking_true_friends']['demo2'] != null) echo $_SESSION['my_booking_true_friends']['demo2'];?>"/>
        				<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/date_20.jpg" alt="" onclick="javascript:NewCssCal('demo2')" style="cursor:pointer"/>
						<label class="labelsecond">Room (s)</label></p>
                  <div class="parent">
                    <select name="sidebar_number_of_room" id="sidebar_number_of_room">
                       	    	<?php
                       	    	for($i=1;$i<=10;$i++)
                       	    	{
                       	    		if(isset($_SESSION['my_booking_true_friends']) && $_SESSION['my_booking_true_friends']['sidebar_number_of_room']==$i)
                       	    		{
                       	    		?>
                       	    		<option selected="selected" value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php 	
                       	    		}
                       	    		else 
                       	    		{
                       	    		?>
                       	    		<option value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php	
                       	    		}
                       	    	} 
                       	    	?>                       	    		
                       	    	</select>	
                    </div>
					<div class="clear"></div>
					<div class="div10"></div>
					<p>
						<label class="labelfirst">Type room</label></p>
                  <div class="parent room">
                    <?php 
                            	//$hotel_price = db_select_all_data("hotel_price");                            	
                            	$hotel_price = db_select_all_data_by_hotelID("hotel_price",$postID);
                            	?>
                                <select name="sidebar_type_room" id="sidebar_type_room">
                                	<option value="">Type room</option>
                                	<?php
                                	if($hotel_price)
                                	{
										foreach ($hotel_price as $value) 
										{	
											$key = db_get_key_type_room($value->typeroom);	
											if(isset($_SESSION['my_booking_true_friends']) && $_SESSION['my_booking_true_friends']['sidebar_type_room']==$key)
											{
												?>
												<option selected="selected" value="<?php echo $key;?>"><?php echo $value->typeroom;?></option>
												<?php 
											}	
											else 
											{							
												?>
												<option value="<?php echo $key;?>"><?php echo $value->typeroom;?></option>
												<?php 
											}
										}
                                	} 
									?>
                                </select>	
                    </div>
					<input type="submit" value="" id="booked-hotel-send"/>
					<input type="hidden" name="hidden_booking_hotelid" value="<?php echo $postID;?>">
                    <input type="hidden" name="mybooking" value="hotels"/>  
                    <?php wp_nonce_field('act_activation_booking_sidebar','act_activation_booking_sidebar');?>  
                </form>
            </div>
			<!--end booking-->
			<div class="div10"></div>
			<!--support ++++++++++++++++++ -->
			<?php require_once TEMPLATEPATH.'/controllers/sidebar/support-online.php';?>
			<div class="support">
			<span class="iconsuport"></span>
                <h3>Support Online</h3>
                <div class="clear"></div>
                <ul class="box-bottom">
    		<li class="yahoo">
            	<ul>
            	<?php
            	$i=0;
            	while ($i<$total_member)
            	{
            		if($member[$i])
            		{
            		?>
            		<li>
		                <a href="ymsgr:SendIM?<?php echo $member[$i]['nickname'];?>" title="Liên hệ Tư Vấn 1" rel="nofollow">
		                    <img src="http://mail.opi.yahoo.com/online?u=<?php echo $member[$i]['nickname'];?>&amp;m=g&amp;t=1" alt="Tư Vấn 1"/>
		                </a> 
		                <span><?php echo $member[$i]['support'];?></span>
		            </li>
            		<?php  
            		}           		
            		$i++;
            	} 
            	unset($i);
            	?>                        	
                </ul>
            </li>                    
    		<li class="phone">
            	<ul>
            	<?php
            	$i=0;
            	while ($i<$total_member)
            	{
            		if($member[$i])
            		{
            		?>
            		<li>                                
		                <p><b><?php echo $member[$i]['phone'];?></b> &ndash; <?php echo $member[$i]['name'];?></p>                                                                
		            </li>
            		<?php 
            		}
            		$i++;
            	}
            	unset($i);
            	unset($member);
            	?>                        	                                                     
				   	</ul>
				   </li>
				    
				</ul>
                
			</div>
			<!--end support-->
			<div class="div10"></div>
			<!--subcrib-->
			<div class="support subcrib">
			
                <h3>SUBSCRIBE TO OUR NEWSLETTER</h3>
                <div class="clear"></div>
				<form action="<?php echo WP_MYSITE_URL;?>" method="post">
					<p>
						<input type="text" class="search-box" name="submit_subscriber" id="submit_subscriber"  value="Your Email..." onfocus="if(this.value=='Your Email...')this.value=''" onblur="if(this.value=='')this.value='Your Email...'"/>
						<input type="submit" rel="<?php bloginfo('home');?>/process-request" value="Send" id="go_subscriber" >
						<div id="subscriber_show" style="color: red;"></div>
					</p>
				</form>
			</div>
			<!--end subcrib-->
        </div>
  <script type="text/javascript" src="<?php bloginfo('template_url');?>/js/mysubscriber.js"></script>